package de.shortys.myhome.api.persistence;

import java.util.List;

public abstract class AbstractDao<T> {

	private PersistenceTemplate persistenceTemplate;

	public AbstractDao(PersistenceTemplate persistenceTemplate) {
		this.persistenceTemplate = persistenceTemplate;
	}

	public void create(T obj) {
		persistenceTemplate.create(obj);
	}

	public void delete(T obj) {
		persistenceTemplate.delete(obj);
	}

	public PersistenceTemplate getPersistenceTemplate() {
		return persistenceTemplate;
	}

	public abstract List<T> read();

	public void update(T obj) {
		persistenceTemplate.update(obj);
	}

}
